/*
 * Copyright (c) 2015-2022 Morwenn
 * SPDX-License-Identifier: MIT
 */

//constant definitions for the Boost Sort library

//          Copyright Steven J. Ross 2001 - 2014
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org/libs/sort for library home page.

#ifndef CPPSORT_DETAIL_SPREADSORT_DETAIL_CONSTANTS_H_
#define CPPSORT_DETAIL_SPREADSORT_DETAIL_CONSTANTS_H_

namespace cppsort
{
namespace detail
{
namespace spreadsort
{
namespace detail
{
    //Tuning constants
    enum {
        //This should be tuned to your processor cache;
        //if you go too large you get cache misses on bins
        //The smaller this number, the less worst-case memory usage.
        //If too small, too many recursions slow down spreadsort
        max_splits = 11,
        //It's better to have a few cache misses and finish sorting
        //than to run another iteration
        max_finishing_splits = max_splits + 1,
        //Sets the minimum number of items per bin.
        int_log_mean_bin_size = 2,
        //Used to force a comparison-based sorting for small bins, if it's faster.
        //Minimum value 1
        int_log_min_split_count = 9,
        //This is the minimum split count to use spreadsort when it will finish in one
        //iteration.  Make this larger the faster std::sort is relative to integer_sort.
        int_log_finishing_count = 31,
        //Sets the minimum number of items per bin for floating point.
        float_log_mean_bin_size = 2,
        //Used to force a comparison-based sorting for small bins, if it's faster.
        //Minimum value 1
        float_log_min_split_count = 8,
        //This is the minimum split count to use spreadsort when it will finish in one
        //iteration.  Make this larger the faster std::sort is relative to float_sort.
        float_log_finishing_count = 4,
        //There is a minimum size below which it is not worth using spreadsort
        min_sort_size = 1000
    };
}}}}

#endif // CPPSORT_DETAIL_SPREADSORT_DETAIL_CONSTANTS_H_
